package com.example.authority.controller;

import cn.hutool.json.JSONUtil;
import com.example.authority.common.Result;
import com.example.authority.entity.dto.GeneratorDto;
import com.example.authority.service.GeneratorService;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.io.IOException;
import java.sql.SQLException;

/**
 * @program: authority-hm-0.0.1
 * @ClassName:GeneratorController
 * @description: 代码生成器前端控制器
 * @author:dyy
 * @Version 3.0
 **/
@RestController
@RequestMapping("/generator")
@Slf4j
public class GeneratorController {
    @Resource
    private GeneratorService generatorService;

    @PostMapping
    public Result generator(@RequestBody GeneratorDto generatorDto) throws SQLException, ClassNotFoundException, InterruptedException, IOException {
        log.warn(JSONUtil.toJsonStr(generatorDto.getDomains()));
//        todo   免费版本不提供代码生成功能,  可以联系作者微信navicat15进行对接！


        return Result.success();
    }


}